<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.Format"%>
<%@page import="firstping.model.Customer"%>
<%
	String title = (String) request.getAttribute("title");
	String error = (String) request.getAttribute("error");
	String description = (String) request.getAttribute("description");
	String keywords = (String) request.getAttribute("keyword");

	String customer = (String) session.getAttribute("customer");
	String name = (String) request.getAttribute("name");
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
	<jsp:param name="description" value="<%=description %>" />
	<jsp:param name="keywords" value="<%=keywords %>" />
	<jsp:param name="page" value="spot-check" />
</jsp:include>
<div id="mainpage">
	<div id="maincontent">
		<h1>Spot Check <%= (name != null)?" : http://"+name:"" %></h1>
		<div class="box-wrapper">
			<%=(error!=null)?error+"<br/>":"" %>
			<div class="accountinfo">
				<div class="leftside">
					<table class="table-style style-colorstripes">
						<thead>
							<tr>
								<th>Location</th>
								<th>Result</th>
								<th>Time (s)</th>
							</tr>
						</thead>						
						<tbody>							
							<tr class="odd" style="background: #6BA80C;">
								<td>App engine</td>
								<td id='result_app' class="result"></td>
								<td id="time_app" class="time"></td>
							</tr>
							<tr>
								<td>US</td>
								<td id='result_us' class="result"></td>
								<td id="time_us" class="time"></td>
							</tr>
							<tr class="odd">
								<td>Canada</td>
								<td id='result_canada' class="result"></td>
								<td id="time_canada" class="time"></td>
							</tr>
							<tr>
								<td>Vietnamese</td>
								<td id='result_vietnam' class="result"></td>
								<td id="time_vietnam" class="time"></td>
							</tr>							
						</tbody>
						
					</table>
				</div>
				<div class="rightside">
					<h2>Spot check</h2>					
					<ul>
						<li>Check the speed of your website at multi-server</li>
						<li class="subinfo">
							<form action="/spot-check" method="get" class="form">
								<input type="text" onclick="javascript:this.value=''" name="name" value="http://example.com">
								<button type="submit" class="button-style">Check</button>
							</form>
						</li>
					</ul>
				</div>

				<div class="clearbreak"></div>
			</div>
		</div>
	</div>
</div>
<%
if(name!=null)
{
%>
<script type="text/javascript">
	var name = '<%=name%>';
</script>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/spotcheck.js"></script>
<%
}
%>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="1" />
</jsp:include>